﻿using Microsoft.AspNetCore.Hosting;
using Quickly.SpaProxy.ReverseProxy;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Builder;

[assembly: HostingStartup(typeof(Quickly.SpaProxy.SpaHostingStartup))]

namespace Quickly.SpaProxy;

internal sealed class SpaHostingStartup : IHostingStartup
{
    public void Configure(IWebHostBuilder builder)
    {
        builder.ConfigureAppConfiguration(builder => builder.AddJsonFile("quickly.spa.proxy.json"));

        builder.ConfigureServices(services =>
        {
            services.AddSpaProxyServices();

            services.AddSpaReverseProxy();
        });
    }
}
